package adv4;

import java.util.Calendar;

public class CalTest {

	public static void main(String[] args) {
		// Calendar c = new Calendar();
		Calendar c = Calendar.getInstance();
		System.out.println(c);
		System.out.println(c.getClass().getName());
		// 取
		int y = c.get(Calendar.YEAR);
		int m = c.get(Calendar.MONTH);
		int day = c.get(Calendar.DAY_OF_MONTH);
		int weekday = c.get(Calendar.DAY_OF_WEEK);
		System.out.println("年" + y + ",月" + m + ",号" + day + ",周几？" + weekday);
		int days = c.get(Calendar.DAY_OF_YEAR);
		System.out.println(days);
		int weeks = c.get(Calendar.WEEK_OF_YEAR);
		System.out.println("本周是几年的第" + weeks + "周");
		// 设置
		c.set(Calendar.DAY_OF_MONTH, 11);
		System.out.println(c.getTime());
		c.set(Calendar.WEEK_OF_YEAR, 50);
		System.out.println("今年的第五十周：");
		System.out.println(c.getTime());

		// 2017-11-12
		// c.set(2017, Calendar.NOVEMBER, 12);
		// 涨：

	}

}
